/**
 * @param {number[]} nums
 * @return {number[]}
 */
 var rearrangeArray = function(nums) {
  let arr1 = [], arr2 = []
  for(let x of nums){
    if(x > 0){
      arr1.push(x)
    }else arr2.push(x)
  }
  let ans = []
  for(let i = 0; i<arr1.length; i++){
    ans.push(arr1[i],arr2[i])
  }
  return ans
};